package com.rogers.monster.dao.impl;

import java.util.HashSet;
import java.util.Set;

import org.springframework.security.core.userdetails.UsernameNotFoundException;

import com.rogers.monster.auth.AppUser;
import com.rogers.monster.dao.UserDao;

public class UserDaoImpl implements UserDao {
    public AppUser findUser(String userName) {
        AppUser appUser = null;
        Set<String> roles = new HashSet<String>();
        if (userName.equals("ada")) {
            roles.add("ROLE_URLACCESS");
            appUser = new AppUser("ada", "ada", "Turner", "adap", roles);
        } else if (userName.equals("maria")) {
        	 roles.add("ROLE_ALLACCESS");
            appUser = new AppUser("maria", "maria", "Daniel", "mariap", roles);
        } else if (userName.equals("linda")) {
            roles.add("ROLE_ALLACCESS");
            appUser = new AppUser("linda", "linda", "Joseph", "lindap", roles);
        } else if (userName.equals("paul")) {
            roles.add("ROLE_ALLACCESS");
            appUser = new AppUser("paul", "paul", "Joseph", "paulp", roles);
        }else if (userName.equals("1")) {
            roles.add("ROLE_ALLACCESS");
            appUser = new AppUser("1", "linda", "Joseph", "1", roles);
        } 
        return appUser;
    }

}
